/**
 * 密码加密
 */

const crypto = require('crypto')

const SECERT_KEY = '8uJo9H^8*9_4$'

const md5 = (content) => {
    const md5 = crypto.createHash('md5')
    return md5.update(content).digest('hex')
}

const getPassword = (password) => {
    const str = `password=${password}&key=${SECERT_KEY}`
    return md5(str)
}

// console.log('getPassword = ', getPassword(123456))

// 39c4c8a397c0510d19b7af768fdf3732

module.exports = {
    getPassword
}